package se.webbzon.boltzmann.game.object.npc;

import se.webbzon.boltzmann.game.character.CharacterException;
import se.webbzon.boltzmann.game.npc.GameNPC;
import se.webbzon.boltzmann.game.npc.GuardingDuty;
import se.webbzon.boltzmann.game.npc.StalkingDuty;
import se.webbzon.boltzmann.game.npc.StandingDuty;
import se.webbzon.boltzmann.game.npc.WalkingDuty;
import se.webbzon.boltzmann.game.object.dialogue.DialogueVoice;
import se.webbzon.boltzmann.game.object.dialogue.Talker;
import se.webbzon.boltzmann.npc.NPCDuty;

public class FriendlyNPC extends GameNPC implements Talker {
	
	private final DialogueVoice voice;
	
	/*============================================================
	Constructors
	============================================================*/
	
	/** Creates a friendly non-player character. **/
	public FriendlyNPC(	String characterTextureSetName, FriendlyAI ai, DialogueVoice voice) 
	throws CharacterException {
		super(0, characterTextureSetName);
		this.voice = voice;
		final NPCDuty d;
		switch (ai) {
			case STANDING: d = new StandingDuty(this); break;
			case WALKING_SMALL: d = new WalkingDuty(this,64,48); break;
			case WALKING_MEDIUM: d = new WalkingDuty(this,192,48); break;
			case WALKING_HUGE: d = new WalkingDuty(this,320,48); break;
			case STALKING_SMALL: d = new StalkingDuty(this,64,64,48); break;
			case STALKING_MEDIUM: d = new StalkingDuty(this,192,192,48); break;
			case STALKING_HUGE: d = new StalkingDuty(this,320,320,48); break;
			case GUARDING: d = new GuardingDuty(this, null); break;
			default: d = new StandingDuty(this,0);
		}
		assignDuty(d);
	}
	
	/*============================================================
	Public Methods
	============================================================*/
	
	@Override public boolean isHostile() {
		return false;
	}

	@Override public DialogueVoice getVoice() {
		return voice;
	}
	
}
